gh-50409: Make action-only tkinter methods return None#152400
Open
serhiy-storchaka wants to merge 1 commit into
Open
gh-50409: Make action-only tkinter methods return None#152400serhiy-storchaka wants to merge 1 commit into
serhiy-storchaka wants to merge 1 commit into
Conversation
Many tkinter and tkinter.ttk methods that merely perform an action returned the empty string or empty tuple produced by the underlying Tcl command instead of None. They now return None, like other action methods. This also affects the setting form of several get/set methods; their querying form is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many
tkinterandtkinter.ttkmethods that merely perform an action returned the empty string or empty tuple produced by the underlying Tcl command instead ofNone. They now returnNone, like other action methods (and like the correspondingEntryandCanvasmethods, which were already correct).Action-only methods:
Spinbox.delete(),Spinbox.icursor(),Spinbox.insert(),Spinbox.invoke(),Spinbox.selection_adjust(),Spinbox.selection_clear(),Wm.wm_deiconify(),Wm.wm_iconify(),Wm.wm_withdraw(),Wm.wm_iconbadge(),Text.edit_redo(),Text.edit_reset(),Text.edit_separator(),Text.edit_undo(),Text.tag_unbind(),PanedWindow.proxy_forget()andPanedWindow.proxy_place().The setting form of these get/set methods now also returns
None(their querying form is unchanged):Spinbox.selection_element(),ttk.Combobox.current(),ttk.Notebook.select(),ttk.Treeview.focus(),ttk.Treeview.cellfocus()andttk.Treeview.cellselection_anchor().